<?php

class bdsmodule_config {
	function form($object) {
		if (!defined('SYS_FORMS')) require_once(BASE.'subsystems/forms.php');
		exponent_forms_initialize();

		$form = new form();
		if (!isset($object->id)) {
            $object->image_col=0;
            $object->big_image_width=200;
            $object->big_image_height=200;
            $object->map_key="";
            $object->max_item=25;
		} else {
            
			$form->meta('id',$object->id);
		}

        $form->register('image_col',"Image Collection",new file_collection_control($object->image_col));
        $form->register('big_width',"Big Image Width",new textcontrol($object->big_image_width));
		$form->register('big_height',"Big Image Height",new textcontrol($object->big_image_height));
        $form->register('map_key',"Google Map API key",new textcontrol($object->map_key));
        $form->register('max_item',"Items per page",new textcontrol($object->max_item));
		$form->register('submit','',new buttongroupcontrol('Save','','Cancel'));
		return $form;
	}

	function update($values,$object) {
        $object->image_col = intval($values['image_col']);
        $object->big_image_width = intval($values['big_width']);
        $object->big_image_height= intval($values['big_height']);
        $object->max_item= intval($values['max_item']);
		$object->map_key= $values['map_key'];
		return $object;
	}
}

?>